package com.googlecode.mailnet.info;

/**
 * Message listener.
 * @author gleb
 */
public interface IMessageListener {
	/**
	 * This method must be called when new message is created by
	 * some message flow and sent.
	 * @param message The message information provider
	 */
	public void onMessageCreated(IMessageInfo message);
	
	/**
	 * This method must be called when message is failed.
	 * @param message The message information provider
     * @param failureType failure type
	 * @param location either {@link ILinkInfo} or {@link INodeInfo} where the message was failed
	 */
	public void onMessageFailed(IMessageInfo message, MessageFailureType failureType, ILocation location);
	
	/**
	 * Called when message is finally delivered.
	 * @param message The message information
	 */
	public void onMessageDelivered(IMessageInfo message);
	
	// public void onMessageRecieved(IMessageInfo message, INodeInfo node);
	
	public void onMessageTransmitted(IMessageInfo message, ILocation location);
	
	// public void onMessagePushed(IMessageInfo message, ILinkInfo link);
	
	// public void onMessagePopped(IMessageInfo message, INodeInfo node);
}
